package com.TIEmulator.FileIOLib;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;

public class IconifiedTextView extends LinearLayout
{
  private final ImageView mIcon;
  private final TextView mText;

  public IconifiedTextView(Context paramContext, IconifiedText paramIconifiedText)
  {
    super(paramContext);
    setOrientation(0);
    this.mIcon = new ImageView(paramContext);
    this.mIcon.setImageDrawable(paramIconifiedText.getIcon());
    this.mIcon.setPadding(0, 2, 5, 0);
    this.mIcon.setScaleType(ImageView.ScaleType.FIT_CENTER);
    addView(this.mIcon, new LinearLayout.LayoutParams(-2, -2));
    this.mText = new TextView(paramContext);
    this.mText.setText(paramIconifiedText.getText());
    addView(this.mText, new LinearLayout.LayoutParams(-2, -2));
  }

  public void setIcon(Drawable paramDrawable)
  {
    this.mIcon.setImageDrawable(paramDrawable);
  }

  public void setText(String paramString)
  {
    this.mText.setText(paramString);
  }

  public void setTextSize(float paramFloat)
  {
    this.mText.setTextSize(paramFloat);
    LinearLayout.LayoutParams localLayoutParams = (LinearLayout.LayoutParams)this.mIcon.getLayoutParams();
    float f = (float)(1.5D * paramFloat);
    localLayoutParams.width = (int)f;
    localLayoutParams.height = (int)f;
    this.mIcon.setLayoutParams(localLayoutParams);
  }
}
